import requests
import csv
import json

if __name__ == '__main__':
    url='http://www.kfc.com.cn/kfccda/ashx/GetStoreList.ashx?op=keyword'
    headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36'}
    data={
    'cname':'',
    'pid':'',
    'keyword': '北京',
    'pageIndex': '1',
    'pageSize': '10'
    }
    res=requests.post(url=url,data=data,headers=headers)
    json_data=res.json()
    print(json_data)